package com.wave.wavesystem.ai.model;

import com.wave.wavesystem.ai.pojo.entity.AiConversationMessage;
import jakarta.validation.constraints.NotNull;
import org.springframework.ai.chat.messages.Message;
import org.springframework.ai.chat.messages.MessageType;

import java.util.Map;

public record WaveMessage(AiConversationMessage message) implements Message {

    public WaveMessage(@NotNull AiConversationMessage message) {
        this.message = message;
    }

    @Override
    public MessageType getMessageType() {
        return MessageType.fromValue(message.getRole());
    }

    @Override
    public String getText() {
        return message.getContent();
    }

    @Override
    public Map<String, Object> getMetadata() {
        return Map.of();
    }
}
